{% load qa_tags %}
{% if instance %}
    {% if instance.in_progress %}
        <abbr title="Started {{ instance.work_started }} by {{ instance.created_by }}"><em>In Progress</em></abbr>
    {% else %}
        {% if perms.qa.can_review %}
            <a class="pull-right" title="Review this session" href="{% url 'review_test_list_instance' instance.pk %}?next={{ request.path|cut:"data/" }}"><i class="fa fa-search-plus"></i></a>
        {% endif %}

        <span class="label-group">
            {% for display,status in statuses.items %}
                <span {% if not status.requires_review %} title="{% if status.reviewed %}Reviewed {{ status.reviewed }} by {{ status.reviewed_by }}.{% else %}Auto reviewed{% endif %}"{% endif %} class="label" style="background-color: {{ status.colour }}">
                    {% if show_icons %}
                        {% if status.requires_review %}
                            <i class="fa fa-question-circle" aria-hidden="true"></i>
                        {% elif not status.valid %}
                            <i class="fa fa-minus-circle" aria-hidden="true"></i>
                        {% endif %}
                    {% endif %}
                    {{ status.count }} {% if show_labels %}{{ display }} {% endif %}
                </span>
            {% endfor %}

            {% if comments %}
                <span class="label label-info">{{ comments }} <i class="fa fa-comment" aria-hidden="true"></i></span>
            {% endif %}
            {% if instance.flagged %}
              <span class="label label-primary"><i class="fa fa-flag" aria-hidden="true"></i></span>
            {% endif %}
        </span>


    {% endif %}
{% else %}
    <em>New List</em>
{% endif %}
